from simcell.cell.protein_bag import ProteinBag

class Cytoskeleton:
    """He decidido, que define entre otras cosas la forma de la celula basandose en las
proteinas que contiene.
Solo admito dos tipos de proteinas:
  - poyi-H -> HH...
  - poly-V -> VV...
"""
    
    def __init__(self):
        self.proteins = ProteinBag()
        
        self.height = 0
        self.width = 0
        self.surface = 0
        
        self.compact_surface = 0 # proteins surface

        self.density = 0.0
        self.ratio = 0.0
    
    def addProtein(protein):
        # add protein
        self.proteins.append(protein)
        
        # recalculate physics
        self.height = max(protein.height, self.height)
        self.width = max(protein.width, self.width)
        self.ratio = self.width / self.height        
        self.surface = self.height * self.width
        self.compact_surface += protein.surface
        self.density = self.surface / self.compact_surface
        
        